package com.zhz.rabbitmq.listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;

/**
 * @date ：Created in 2021/01/30
 * @version: V1.0
 * @slogan: 天下风云出我辈，一入代码岁月催
 * @description: Spring 队列监听器
 **/
public class SpringQueueListener implements MessageListener {
    @Override
    public void onMessage(Message message) {
        //打印消息

        System.out.println("队列监听器");
        System.out.println("消息属性: " + message.getMessageProperties());
        System.out.println("消息内容: " + new String(message.getBody()));
    }
}
